package com.zhf.tests;

import com.zhf.bean.Student;
import com.zhf.service.StudentService;
import org.junit.Test;

import java.util.List;

/**
 * @Author: ZhaoHuanfeng
 * @Date: 2020/10/17 16:30
 */
public class StudentTest {

    @Test
    public void isStudentTest() {
        StudentService studentService = new StudentService();
        boolean studentID = studentService.isStudentID("20200001");
        System.out.println(studentID);
    }


    @Test
    public void getStudent() {
        StudentService studentService = new StudentService();
        Student studentByID = studentService.getStudentByID("20200001");
        System.out.println(studentByID);
    }

    @Test
    public void getStudents(){
        StudentService studentService = new StudentService();
        List<Student> students = studentService.getStudents();
        System.out.println(students);
    }

    @Test
    public void addStudent(){
        StudentService studentService = new StudentService();
        boolean b = studentService.addStudent(new Student("Mary", "20200005", "女", "1899-11-11", "dasima@real.com", "哈撒给","1班"));
        System.out.println(b);
    }

    @Test
    public void delStudentTest(){
        StudentService studentService = new StudentService();
        boolean b = studentService.deletStudent("20200005");
        System.out.println(b);
    }

    @Test
    public void updateStudentTest(){
        StudentService studentService = new StudentService();
        boolean b = studentService.updateStudent(new Student("Mark", "20200005", "男", "1991-01-23", "mafeifei@real.com", "牛逼啊！开哥~","2班"));
        System.out.println(b);
    }

    @Test
    public void isStudentNullTest(){
        StudentService studentService = new StudentService();
        boolean studentNull = studentService.isStudentNull("1");
        System.out.println(studentNull);
    }
}
